package me.zhengjie.modules.system.repository;

import me.zhengjie.modules.system.domain.Contract;
import me.zhengjie.modules.system.domain.UserInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

public interface ContractRepository extends JpaRepository<Contract, Long>, JpaSpecificationExecutor<UserInfo> {

    // 根据客户id查询合同信息
    @Query(value = "SELECT * FROM user_contract a WHERE a.users_info_id = ?1",nativeQuery = true)
    Contract findByUserInfoId(String userInfoId);
}
